package org.test;

import java.util.*;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class Single {

    private static volatile Single single=null;

    private Single(){}

    public static Single getSingle(){

        if (single==null){
            synchronized (Single.class){
                if (single==null){
                    single=new Single();
                }
            }
        }

        return single;

    }

    public static void main(String[] args) {
        //HashMap;
        //ConcurrentHashMap;
//        AtomicInteger;
        Lock lock=new ReentrantLock();
        Integer i=new Integer(199);
        int j=199;
        Integer m=100;
        int n=100;
        System.out.println(i==j);
        System.out.println(m==n);


        System.out.println("====================");

        LinkedList<Integer> l = new LinkedList<>();

        l.add(1);
        l.add(2);
        l.add(3);
        l.add(4);
        l.add(5);

        Map<String,Integer> map=new HashMap<>();

        List<Integer> list=new ArrayList<>();

        for (int h=0;h<l.size();h++) {
            System.out.println(l.remove());
        }

    }

}

